import { Operation } from "./operation"
import RemoveTextOperation from "./remove_text_operation"
export class InsertTextOperation extends Operation {
    constructor (spacers, insertIndex) {
        super()
        this.spacers_ = spacers
        this.insertIndex_ = insertIndex
    }
    getSpacers () {
        return this.spacers_
    }
    setSpacers (spacers) {
        this.spacers_ = spacers
    }
    apply (editor) {
        editor.getTextModel().insert(this.insertIndex_, this.spacers_)
    }
    reverse () {
        return new RemoveTextOperation(this.insertIndex, this.insertIndex_ + this.spacers_.length)
    }
}
export default InsertTextOperation